﻿
using HBase;
using hCommand;
using Net.http;
using Persistence;
using System.Collections.Generic;

namespace WebApi {
    [RoutePrefix("api/dp")]
    public class DapingController :BaseApiController {
        ICoreStockServer coreStockServer = WMSDalFactray.getDal<ICoreStockServer>();
        ICoreWhLocServer locServer = WMSDalFactray.getDal<ICoreWhLocServer>();
        ICSDServer csdServer = WMSDalFactray.getDal<ICSDServer>();
        [HttpGet, Route("d/{id}")]
        public BaseResult data(int id) {
       
            List<DapingDto> l = locServer.getDapingDto(id);
            return new BaseResult(l);

        }

        [HttpGet, Route("load/{id}")]
        public BaseResult load(int id) {
    
            CoreStock cs = coreStockServer.getCoreStockByLocId(id);
            if( cs == null ) {
                return new BaseResult("NoData");
            }
            List<CoreStockDet> list = csdServer.GetListByStockId(cs.id);
            return new BaseResult(new { cs = cs ,list = list });

        }

    }
}
